<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-sclae=1.0,user-scalable=0">
	<title>xuluo</title>
	<style type="text/css">
		*{margin:0;padding:0;font-family:'microsoft yahei',SimSun}
		li,ul{list-style:none}
		a{text-decoration:none;outline:0;color:inherit}
		img{border:none;vertical-align:middle}
		button,input,select,textarea{outline:0;border:none;color:inherit;font-size:inherit}
		.btn{display:inline-block;padding:0 22px;height:35px;line-height:35px;background:#009688;color:#fff;font-size:15px;cursor:pointer;vertical-align:middle;border-radius:2px}
		.btn:hover{opacity:1;filter:alpha(opacity=100)}
		.btn:active{opacity:.9;filter:alpha(opacity=90)}
	</style>
</head>
<body>
	<div class="wrap" style="margin: 20px auto;display: table;text-align: center;color: #666;">
		<input type="text" id="text" style="outline: none;border: 1px solid #ddd;padding: 5px 20px;margin-bottom: 15px;"><br>
		<input type="button" value="生成二维码" class="btn" onclick="qrcode()">
		<div id="qrcode" style="display: table;margin: 20px auto;"></div>
	</div>
	<script type="text/javascript" src="js/qrcode.min.js"></script>
	<script>
		var qrcode = function(){
			var url=document.querySelector('#text').value;
			new QRCode(document.getElementById("qrcode"), {
				text: url,
				width: 128,
				height: 128,
				colorDark : "#000000",
				colorLight : "#ffffff",
				correctLevel : QRCode.CorrectLevel.H
			});
		};
	</script>
</body>
</html>